package task03;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/4/8 8:57
 * @description: 测试类
 */
public class Demo {

  public static void main(String[] args) {
    /* 创建2个商品对象*/
    Product p1=new Product();
    p1.setName("茶叶蛋");
    Product p2=new Product();
    p2.setName("酸奶");

    /* 创建超市对象,让超市有上述2个商品*/
    Market market = new Market();
    market.setName("十足");
    Product[] p = {p1,p2};
    market.setProducts(p);

    /*创建1个商品对象*/
    Product p3=new Product();
    p3.setName("作业");


    /*创建顾客对象，调用方法去超市买商品*/
    Custom custom=new Custom();
    custom.setName("小王");
    custom.shopping(market,p1);
    custom.shopping(market,p3);
  }

}
